#ifndef MARKET_H_
#define MARKET_H_
#include "CommonDef.h"
#include "Event.h"
#include <vector>
class ObjectsContainer;
class User;
using namespace ass2;


class Market
{
	private:
		ObjectsContainer* prices;
		ObjectsContainer* amounts;
		ObjectsContainer* sayaBuying;
		ObjectsContainer* sayaSelling;
		vector<User*> users;
		bool sayaOn;
		bool sayaSell;
		void initPrices(double price);
		//User* Unknown user;

	public:
		Market(vector<User*> users, double price, bool sayaOn_);
		virtual ~Market();
		void deal(Event buying,Event selling);
		void addEnergyAmount(string name,int amount);
		void removeEnergyAmount(string name,double amount);
		bool SayaCreateBuyingEvent(string energyType);
		bool SayaCreateSellingEvent(string energyType);
		double getEnergyPrice(string energyType);
};


#endif /*MARKET_H_*/
